import 'package:flutter/material.dart';
import 'package:untitled/pages/home/info/data.dart';
import 'package:untitled/widgets/common_image.dart';

var textStyle = TextStyle(color: Colors.black54);
class ItemWidget extends StatelessWidget {
  final InfoItem data;

  const ItemWidget(this.data,{Key key}) : super(key: key);


  @override
  Widget build(BuildContext context) {
    return Container(
      height: 100,
      padding: EdgeInsets.only(left: 10.0,right: 10.0,bottom: 10.0),
      child: Row(children: [
        CommonImage(src:data.imageUrl,width: 120.0,height: 90.0,),
        SizedBox(width: 10,),
        Expanded(child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,//父控件必须有个高度才会生效
          children: [
            Text(data.title,style: TextStyle(fontWeight: FontWeight.w600,color: Colors.black),),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(data.source,style: textStyle,),
                Text(data.time,style: textStyle,)
              ],
            )
          ],
        ))

      ],
      ),
    );
  }
}
